<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
         #container{
  
      width:80%;
      background:#E8E8E8;
      margin: 0 auto;
      margin-top: 20px;
      border-radius: 4px;
        background-color: #eee;
        /*#ee*/
  
  }
  #row1{
  
background:#E8E8E8;
     height: 340px;
  
  }
  #logo{
     
     width: 750px;
     color: blue;
     font-size: 14px;
     
      text-shadow: 10px 10px 0 #ffd217, 20px 20px 0 #5ac7ff, 30px 30px 0 #ffd217, 40px 40px 0 #5ac7ff;
      /*background:#E8E8E8;*/
      border-radius:8px;
  
  }
  #logo h1{
     width: 800px;
  	text-align: center;	
	font-family: "League-Gothic", Courier;
	font-size: 100px; 
	text-transform: uppercase;
	color: #fff;
	text-shadow: 10px 10px 0 #ffd217, 20px 20px 0 #5ac7ff, 30px 30px 0 #ffd217, 40px 40px 0 #5ac7ff;
  }
   
#conteudo{
border-radius:8px;


}


#form{
  
 margin:0 auto;
 width:25%;
 background:#E8E8E8;
 padding:10px; 
 border-radius:8px;

}
    </style>
        <link rel="stylesheet" href="bootstrap-3.1.1-dist/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="bootstrap-3.1.1-dist/css/bootstrap-theme.css">

<!-- Latest compiled and minified JavaScript -->
<script src="bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<script type="text/javascript">

function numeros( campo )
{
    if ( isNaN( campo.value ) )
        campo.value = campo.value.substr( 0 , campo.value.length - 1 );
}


</script>
    </head>
    <body>
        <?php 

            require_once 'conecta.php';
            include "verifica.php"; 
            

            //iniciando sessao
            session_start();
            $id=  $_SESSION[id];
            $nome = $_SESSION[nome];          
            $email = $_SESSION[email];



            //pegando os dados do user
            $sqlUser = "SELECT * FROM tb_pessoa WHERE idPessoa='$id'";

            $resulUser = mysql_query($sqlUser);

            $num = mysql_num_rows($resulUser);

            if($num == 0){

                header("location:logout.php");

            }else{
                
                $registerUser = mysql_fetch_row($resulUser);

                $idUser = $registerUser[0];
                $nomeUser =$registerUser[4];
                $userPontosId = $registerUser[6];
                //echo $userPontosId;
                $sqlPontos = "SELECT U.ponto FROM tb_pontuacao U WHERE U.idPonto='$userPontosId'";             
                $resulPontos = mysql_query($sqlPontos);
                $numRsql = mysql_num_rows($resulPontos);	
                if($numRsql == 0){
                    header("location:logout.php");
                }else{

                    $userPonto = mysql_result($resulPontos,0,ponto);
                  //  echo "ola->".$userPonto;
                }
            }    

        ?>
    <div id="container">
   
         <div id="conteudo">
             
                 <ul class="nav nav-pills">
  
                 <li class="active"><a href="bolao.php">Home </a></li>  
                <li class="active"><a href="classi.php">Classificação </a></li>  
           &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp  <li class=""><a href="logout.php">Sair</a></li>   <strong style="font-size: 30px;">Usuario</strong> :  <a style="font-size:28px;"><?php echo $nomeUser;?> </a>
                     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp   <strong style="font-size: 30px;">Pontos</strong> :  <a style="font-size:28px;"><?php echo $userPonto;?></a>
               </ul>
             
           <?php 
           
          
              $sqlRodada = "SELECT rod1 FROM tb_pessoa , tb_rodada WHERE idPessoa= '$id' AND idRodada= id";
              $resul = mysql_query($sqlRodada);
             // $regiRod = mysql_fetch_row()
              $userRod1 = mysql_result($resul,0,rod1);
            //  echo "rodada 1 = ".$userRod1;

              $sqlJogo = "SELECT id FROM tb_jogos";
              $resulJogo = mysql_query($sqlJogo);
              $numJogos = mysql_num_rows($resulJogo);
              if($numJogos!= 0){

                 
                 // $registro2Jogos = mysql_fetch_row($resulJogo);
                  $i = 0;
                  while($registroJogos = mysql_fetch_row($resulJogo)){

                     $vectorJogos[$i] = $registroJogos[0];
                     $i++;
                  }

              }
            // echo "jogo -> ".$registroJogos[0];

                  $dataI= '2014-05-26';

                        // trabalhando a primeira data
                        $I= strtotime($dataI );

                        // segunda data
                        $dataII= '2014-06-12';

                        // trabalhando a segunda data
                        $II= strtotime($dataII);


                            //primeira rodada
                           $dataPrimRodadaIni= strtotime('2014-06-13');
                           $dataPrimRodadaFim= strtotime('2014-06-16');

                            //segunda rodada
                           $dataSegundaRodadaIni= strtotime('2014-06-13');
                           $dataSegundaRodadaFim= strtotime('2014-06-16');

                            //terceira rodada
                           $dataTerceiraRodadaIni= strtotime('2014-06-17');
                           $dataTerceiraRodadaFim= strtotime('2014-06-22');
         if(strtotime("now") >= $I && strtotime("now") <= $II && $userRod1==0 ){
?>
     <!-- primeiro -->
      
       
                <div class="panel panel-default">
                        <div class="panel-heading">
                        
                               <div class="row">                                                                
                                      
                  
                                                    <div class="panel panel-primary">                                                   
                                                    
                                                       <div class="panel-heading">1° Rodada: <strong>Chave de Grupos</strong></div>
                                                   
                                                          <div class="panel-body">
                                                          
                                                               <div class="row"><!--  row do form primeira rodada -->
                                                                 
                                                                     <form class="form-inline" action="rodada1.php" method="post">                                                               
                                                                    
                                                                           <div class="col-xs-6 col-md-4">
                                                                              <span class="label label-primary">Grupo A</span><br/><br/>
                                                                                <div class="form-group">
																			         BRA <img src="imagens/rodada1/brasil.png"/>
																			         <input type="text" class="form-control" onkeyup="numeros(this);" id="inputEmail" name="brasilrod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" onkeyup="numeros(this);" class="input-small" name="croaciarod1" placeholder="" size="3" maxlength="2" required="">
																	                   <img src="imagens/rodada1/croacia.png"/> CRO 
																	            </div>
		                                                                        <br/><br/>

                                                                            <div class="form-group">
																			          MEX <img src="imagens/rodada1/mexico.png"/>
																			         <input type="text" class="form-control" onkeyup="numeros(this);" name="mexicorod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control"  onkeyup="numeros(this);" class="input-small" name="camaraorod1"  placeholder="" size="3" maxlength="2" required="">
																	                   <img src="imagens/rodada1/camaroes.png"/> CAM 
																	            </div><br/><br/>    
                                              <input type="hidden" name="jogo1idA" value="<?php echo $vectorJogos[0]; ?>">
                                              <input type="hidden" name="jogo2idA" value="<?php echo $vectorJogos[1]; ?>">
																	              <hr/>                                                                   
                                                                           </div>

  																		   <div class="col-xs-6 col-md-4">
  																		          <span class="label label-primary">Grupo B</span><br/><br/>
  																		        <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> ESP <img src="imagens/rodada1/espanha.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="espanharod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control"  onkeyup="numeros(this);" class="input-small" name="holandarod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/holanda.png"/> HOL 
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> CHI <img src="imagens/rodada1/chile.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="chilerod1" placeholder="" size="3" maxlength="2">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small"  onkeyup="numeros(this);" name="auxrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/australia.png"/> AUS 
																	            </div><br/><br/> 
                                                 <input type="hidden" name="jogo1idB" value="<?php echo $vectorJogos[2]; ?>">
                                                 <input type="hidden" name="jogo2idB" value="<?php echo $vectorJogos[3]; ?>">
                                               <hr/> 

  																		   </div>

 																		   <div class="col-xs-6 col-md-4">
 																		          <span class="label label-primary">Grupo C</span><br/><br/>
 																		           <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> COL <img src="imagens/rodada1/colombia.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="colrod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="greciarod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/grecia.png"/> GRE 
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> CDM <img src="imagens/rodada1/costa_do_marfim.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="cdmrod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" onkeyup="numeros(this);" class="input-small" name="japrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/japao.png"/> JAP 
																	            </div><br/><br/> 
                                                   <input type="hidden" name="jogo1idC" value="<?php echo $vectorJogos[4]; ?>">
                                                 <input type="hidden" name="jogo2idC" value="<?php echo $vectorJogos[5]; ?>">
                                                <hr/> 
 																		   
 																		   </div>
 																		   <div class="col-xs-6 col-md-4">
 																		          <span class="label label-success">Grupo D</span><br/><br/>
 																		           <div class="form-group">
																			        URU <img src="imagens/rodada1/uruguai.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="ururod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small"  onkeyup="numeros(this);" name="cosrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/costa_rica.png"/> COS 
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			        ING <img src="imagens/rodada1/inglaterra.png"/>
																			         <input type="text" class="form-control" id="inputEmail"  onkeyup="numeros(this);" name="ingrod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);"  name="itarod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/italia.png"/> ITA 
																	            </div><br/><br/>  
                                                  <input type="hidden" name="jogo1idD" value="<?php echo $vectorJogos[6]; ?>">
                                                 <input type="hidden" name="jogo2idD" value="<?php echo $vectorJogos[7]; ?>">

                                              <hr/>  
 																		   
 																		    </div>
 																		   <div class="col-xs-6 col-md-4">
 																		          <span class="label label-success">Grupo E</span><br/><br/>
 																		           <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> SUI <img src="imagens/rodada1/suica.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="suirod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="equrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/equador.png"/> EQU 
																	            </div>
		                                                                        <br/><br/>  
                                                                                <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> FRA <img src="imagens/rodada1/franca.png"/>
																			         <input type="text" class="form-control" id="inputEmail" name="frarod1" onkeyup="numeros(this);" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="honrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/honduras.png"/> HON 
																	            </div><br/><br/>  
                                                  <input type="hidden" name="jogo1idE" value="<?php echo $vectorJogos[8]; ?>">
                                                 <input type="hidden" name="jogo2idE" value="<?php echo $vectorJogos[9]; ?>">

                                                <hr/>
 																		     
 																		   </div>
   																	       <div class="col-xs-6 col-md-4">
 																		          <span class="label label-success">Grupo F</span><br/><br/>
 																		           <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> ARG <img src="imagens/rodada1/argentina.png"/>
																			         <input type="text" class="form-control" id="inputEmail" name="argrod1" onkeyup="numeros(this);" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="bosrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/bosnia.png"/> BOS 
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> IRA <img src="imagens/rodada1/ira.png"/>
																			         <input type="text" class="form-control" id="inputEmail"  onkeyup="numeros(this);" name="irarod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="ngarod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/nigeria.png"/> NGA 
																	            </div><br/><br/>   
                                                 <input type="hidden" name="jogo1idF" value="<?php echo $vectorJogos[10]; ?>">
                                                 <input type="hidden" name="jogo2idF" value="<?php echo $vectorJogos[11]; ?>">

                                              <hr/> 
 																		   
 																		   </div>
																		   <div class="col-xs-6 col-md-4">
 																		          <span class="label label-danger">Grupo G</span><br/><br/>
 																		           <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> ALE <img src="imagens/rodada1/alemanha.png"/>
																			         <input type="text" class="form-control" id="inputEmail" name="alerod1" onkeyup="numeros(this);" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="porrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/portugal.png"/> POR 
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> GAN <img src="imagens/rodada1/gana.png"/>
																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="ganrod1" placeholder="" size="3" maxlength="2" required="">
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                             <label class="" for="inputEmail">x</label>
		                                                                       </div>
																	            <div class="form-group">
																	                   <input type="text" class="form-control" class="input-small"  onkeyup="numeros(this);" name="euarod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/estados_unidos.png"/> EUA 
																	            </div><br/><br/>  
                                                 <input type="hidden" name="jogo1idG" value="<?php echo $vectorJogos[12]; ?>">
                                                 <input type="hidden" name="jogo2idG" value="<?php echo $vectorJogos[13]; ?>">
                                               <hr/> 
 																		   
 																		   </div> 																		   
 																		   <div class="col-xs-6 col-md-4">
   																		          <span class="label label-danger">Grupo H</span><br/><br/>
   																		           <div class="form-group">
  																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> BEL <img src="imagens/rodada1/belgica.png"/>
  																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="belrod1" placeholder="" size="3" maxlength="2" required="">
  		                                                                        </div>
  		                                                                       <div class="form-group">
  		                                                                             <label class="" for="inputEmail">x</label>
  		                                                                       </div>
  																	            <div class="form-group">
  																	                   <input type="text" class="form-control" onkeyup="numeros(this);" class="input-small" name="aglrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
  																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/argelia.png"/> AGL 
  																	            </div>
  		                                                                        <br/><br/>
                                                                                  <div class="form-group">
  																			        <!-- <label class="" for="inputEmail">Brasil  </label>  --> RUS <img src="imagens/rodada1/russia.png"/>
  																			         <input type="text" class="form-control" id="inputEmail" onkeyup="numeros(this);" name="rusrod1" placeholder="" size="3" maxlength="2" required="">
  		                                                                        </div>
  		                                                                       <div class="form-group">
  		                                                                             <label class="" for="inputEmail">x</label>
  		                                                                       </div>
  																	            <div class="form-group">
  																	                   <input type="text" class="form-control" class="input-small" onkeyup="numeros(this);" name="corrod1" id="inputPassword" placeholder="" size="3" maxlength="2" required="">
  																	                   <!--<label class="" for="inputPassword"> Croácia</label>  --> <img src="imagens/rodada1/coreia_do_sul.png"/> COR 
  																	            </div><br/><br/>   
                                                 <input type="hidden" name="jogo1idH" value="<?php echo $vectorJogos[14]; ?>">
                                                 <input type="hidden" name="jogo2idH" value="<?php echo $vectorJogos[15]; ?>">

                                                <hr/> 
 																		   
 																		   </div> 																		   
 																		   <div class="col-xs-6 col-md-4">
 																		          
 																		        <div class="form-group">
																			       
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                            
		                                                                       </div>
																	            <div class="form-group">
																	                   
																	            </div>
		                                                                        <br/><br/>
                                                                                <div class="form-group">
																			       
		                                                                        </div>
		                                                                       <div class="form-group">
		                                                                               <button type="submit" class="btn btn-primary">Limpar Tudo</button>
		                                                                       </div>
																	            <div class="form-group">
																	                     <button type="submit" class="btn btn-success">Confirmar Aposta</button>
																	            </div><br/><br/><br/>
 																		   </div>
 																  	 </form>	                                                              
                                                              
                                                               </div>
                                                    
                                                          </div>
                                                          
                                                       </div>   
          
                                 </div>                                                     
                                                                                                
                           </div><!--panel-heading-->
                  </div><!--panel panel-default-->
   
        
   


</div>
</div><!--  fim container -->
      
      
      
         <?php }else if(strtotime("now") >= $dataSegundaRodadaIni && strtotime("now") <= $dataSegundaRodadaFim){?>
      
      segunda
      
         <?php }else if(strtotime("now") >=$dataTerceiraRodadaIni && strtotime("now") <= $dataTerceiraRodadaFim ){?>
      terceira
         <?php }else{ ?>

                          <div class="panel panel-primary">                                                   
                                                    
                                                       <div class="panel-heading"></div>
                                                   
                                                          <div class="panel-body">
                                                          
                                                               <div class="row"><!--  row do form primeira rodada -->
                                                                    <div class="jumbotron">
                                                                    <h1>Aguarde a liberação da aposta...</h1>
                                                                    <p>...</p>
                                                                    
                                                                  </div>
                                                               </div> 
                                                           </div> 
                                                        </div> 
                        </div>                                        
         <?php  } ?>

          <?php


                       if(isset($_GET["ok"])){

                      
                         echo "<div class='alert alert-success'<strong>".$_GET['ok']."</strong></div>"; 

                       }else if(isset($_GET["erro"])){
                           
                            echo "<br/><div class='alert alert-danger'<strong>".$_GET['erro']."</strong></div>";

                       }


                                        ?>       
    </body>
</html>
